package workflow

import (
	"zstackgo/pkg/header/errorcode"
)

type FlowChain interface {
	GetFlows() []Flow
	Insert(flow Flow) FlowChain
	InsertPos(pos int, flow Flow) FlowChain
	SetFlowMarshaller(marshaller FlowMarshaller) FlowChain
	Then(flow Flow) FlowChain
	Done(handler FlowDoneHandler) FlowChain
	Error(handler FlowErrorHandler) FlowChain
	CtxHandler(handler FlowContextHandler) FlowChain
	Finally(handler FlowFinallyHandler) FlowChain
	SetData(data Map) FlowChain
	PutData(k string, v any) FlowChain // not multi
	SetName(name string) FlowChain
	PreCheck(checker func(Map) *errorcode.ErrorCode) FlowChain
	SetProcessors(processors []FlowChainProcessor)
	GetData() Map
	Start()
	NoRollback(no bool) FlowChain
	AllowEmptyFlow() FlowChain
	AllowWatch()
}
